package com.team5.stockservice.feign;

import com.team5.stockservice.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "BASE-SERVICE")
public interface GoodsService {
      @GetMapping("user/test1")
      List<Goods> select(@RequestParam("providerid")Integer providerid, @RequestParam("goodsname")String goodsname, @RequestParam("productcode")String productcode,
                         @RequestParam("promitcode")String promitcode, @RequestParam("description")String description, @RequestParam("size")String size, @RequestParam("index")Integer index, @RequestParam("limit")Integer limit);

      @GetMapping("user/test1")
      void insert(@RequestParam("providerid")Integer providerid,@RequestParam("goodsname")String goodsname,@RequestParam("productcode")String productcode,
                        @RequestParam("promitcode")String promitcode,@RequestParam("description")String description,@RequestParam("size")String size,@RequestParam("produceplace")String produceplace,
                        @RequestParam("goodspackage")String goodspackage,@RequestParam("price")Double price,@RequestParam("number")Integer number,@RequestParam("dangernum")Integer dangernum,@RequestParam("available")Integer available);

      @GetMapping("user/test1")
      void delete(Integer id);

      @GetMapping("user/test1")
      void update(@RequestParam("id")Integer id,@RequestParam("providerid")Integer providerid,@RequestParam("goodsname")String goodsname,@RequestParam("productcode")String productcode,
                        @RequestParam("promitcode")String promitcode,@RequestParam("description")String description,@RequestParam("size")String size,@RequestParam("produceplace")String produceplace,
                        @RequestParam("goodspackage")String goodspackage,@RequestParam("price")Double price,@RequestParam("number")Integer number,@RequestParam("dangernum")Integer dangernum,@RequestParam("available")Integer available);

      @GetMapping("user/test1")
      List<Goods> selectGoodsName();

      @GetMapping("user/test1")
      void updateNumber(@RequestParam("id")Integer id,@RequestParam("number")Integer number);

      @GetMapping("user/test1")
      List<Goods> selectByProviderid(Integer providerid);

      @GetMapping("user/test1")
      Goods selectById(Integer id);
}
